# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ayatana-ido
pkgver=0.9.2
pkgrel=0
pkgdesc="Ayatana Indicator Display Objects"
url="https://github.com/AyatanaIndicators/ayatana-ido"
arch="all"
# slightly unclear at the moment, see https://github.com/AyatanaIndicators/ayatana-ido/issues/55
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only"
makedepends="
	cmake
	cmake-extras
	glib-dev
	gtest-dev
	gtk+3.0-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev"
source="https://github.com/AyatanaIndicators/ayatana-ido/archive/$pkgver/ayatana-ido-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
efc5825d32d707b02397692c347f99f3bca13da2cd653b6ce87882643c85c2698bdac6168e89a01ed98d5ee58c88a820d89dad7b88a5aee235b450c40969d0a7  ayatana-ido-0.9.2.tar.gz
"
